package com.seal.tsms.system.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by seal.jing on 2016/1/5.
 */
@Entity
@Table(name = "SYS_RESOURCE_ROLE")
@IdClass(ResourceRolePk.class)
public class ResourceRole implements Serializable{
    private SystemResource resource;
    private SystemRole role;

    @Id
    @ManyToOne()
    @JoinColumn(name = "RESOURCE_ID")
    public SystemResource getResource() {
        return resource;
    }

    public void setResource(SystemResource resource) {
        this.resource = resource;
    }

    @Id
    @ManyToOne()
    @JoinColumn(name = "ROLE_ID")
    public SystemRole getRole() {
        return role;
    }

    public void setRole(SystemRole role) {
        this.role = role;
    }
}
